home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d2 / romtools.arc / ROMTOOLS.DOC < prev    next >
Text File  |  1988-01-12  |  6KB  |  117 lines

  1.  --- DOCUMENTATION FOR the CHKSUM , SPLIT and ADDROMS program USAGE---
  2.  
  3.      Anyone intersted in the source codes for these programs,
  4.      send $5 to the address below to cover disk & mailing costs. 
  5.  
  6.  **** BOTH PROGRAMS REQUIRE DOS 3.0 AND UP *****NO CHECK IS MADE
  7.  
  8.  -----------------------------------------------|
  9.  WRITTEN  by:   Pete Korner        |
  10.          10509 Hunt Ave.        |
  11.          South Gate, Ca. 90280    |
  12.          213-533-8568        |
  13.  -----------------------------------------------|
  14.  
  15.     CHKSUM provides the true checksum of any file, any size, but primarily
  16.     written to use on PC/AT roms. The roms may be edited but their cheksum
  17.     must be adjusted to end with 00 in order for them to boot up. The first
  18.     two bytes (I.E.  XX00) can end up to be any hex charaters.
  19.  ------------------------------------------------------------------------
  20.     SPLIT separates a rom file into even and odd byte files for eprom use
  21.     in the AT or AT clone type computers.
  22.  -------------------------------------------------------------------------
  23.     ADDROMS reverses the action of SPLIT , combines even and odd roms files
  24.     into one file which allows for easier editing.
  25.  --------------------------------------------------------------------------
  26.     PC/XT roms are 8 bit and DO NOT require splitting into evn/odd files.
  27.  
  28.     Note: PC/XT clones have no basic roms, only the BIOS. The rom
  29.     is at fe00:0 to fe00:ffff for 2000h bytes. Change the move
  30.     address in AT's debug routine to fe00:0 2000 cs:100 and set CX to
  31.     2000h instead of 8000h and only one file needs to be named/written.
  32.     IBM PC/XT basic rom adresses are at f600:0 , f800:0 , fa00:0 and
  33.     fc00:0  for the four basic roms. The PC/XT BIOS rom is at fe00:0 .   
  34.  ---------------------------------------------------------------------------
  35.    
  36.     If you are interested in editing your roms, READ the rest of this file.
  37.     I'll go through a relatively simple example of editing the disk para-
  38.     meter table and 'fixing' up the checksum afterwords.
  39.  ----------------------------------------------------------------------------
  40.  
  41.     The following debug routine may be used to read the AT or AT clone roms.
  42.  
  43.     
  44.      debug 'CR'        ;start debug
  45.      -        ;debug's cursor
  46.      rcx        ;set CX register
  47.      8000        ;for 8000h bytes
  48.      n 1st.hlf        ;name for the 1st half of rom     
  49.      m f000:0 8000 cs:100    ;move 1st half of rom into debug's segment
  50.      w        ;write the file to disk
  51.      n 2nd.hlf        ;name fo 2nd half of rom
  52.      m f800:0 8000 cs:100    ;move 2nd half of rom into debug's segment
  53.      w        ;write the file to disk
  54.      q        ;quit debug
  55.  
  56.   At this point we have two files, 1st.hlf and 2nd.hlf 32768 decimal bytes
  57.   each. Most AT clones have 128k roms, in which case the 1st.hlf is all 'ff's
  58.   and we do not need it. In this case the 2nd.hlf file is the complete bios.
  59.  
  60.   IBM's AT roms are 256k each so we need to combine the two files. Use the 
  61.   folowing commands from dos.
  62.      copy  /b  1st.hlf+2nd.hlf atrom    ;creates new file ATROM
  63.      del  1st.hlf         ;we do not need
  64.      del  2nd.hlf        ;these any more
  65.  
  66.   Now we have the complete ROM in one file. Running the chksum program
  67.   should yield a hex number which ends with '00'. All roms must have a 
  68.   'XX00' cheksum, otherwise they won't boot.
  69.   In the AT roms the hard disk parameter table starts at 'offset 6401' ,
  70.   6501 if using debug. Each group of 16h bytes corresponds to a 'type' ,
  71.   of hard disk starting with type 1 at offset 6501.
  72.   This table may be modified if you are installing a hard disk whose
  73.   parameters do not match any of the standard values in the rom.
  74.   [i.e. # of cylinders, heads etc.] We can maximize hard disk capacities
  75.   by matching these parameters.
  76.   I modified my AT clone's rom for RLL use with the WD 1003 - RA2
  77.   controller by replacing the 11h [# of setors/track] byte in the 
  78.   table with 1Ah [26 sectors]. This provided 50% more capacity on my 
  79.   hard disk.
  80.   After modification the checksum must be made to end with 00's again.
  81.   Here is how we can do it...
  82.   After modifing the rom file to your liking write it back out to 
  83.   disk with debug's 'W'command.
  84.   Run the chksum program on the file.
  85.   Write down the new checksum.
  86.   Let's say the new checksum is 2233h.
  87.   Load the modified rom file again with debug. [i.e debug atrom]
  88.   Type the following at debug's prompt:    H ffff 2233
  89.   Debug comes back with the sum and diff:  2232 DDCC
  90.   What we need is the last two bytes of the difference. The 'CC'.
  91.   We need to change an unused 'FF' in the rom to 'CC'.
  92.  
  93.   The starting precomp cylinder bytes for some AT hard disks is ff ff
  94.   in the table. 
  95.   At 6556 and 6557 we find a couple of 'ff's corresponding to
  96.   the precom cyl. bytes for type 6 hard disk.
  97.   This disk is 615 cyl 4 heads [20meg] with the precom cyls. 'ff ff'
  98.   As long as the precomp cyls # is greater then the # of cylinders
  99.   [6702h  reversed = 0267h = 615dec ] the controller will not format
  100.   any cylinders with precomp. 
  101.   So we can freely change the first byte to anything so our checksum
  102.   will come out to "xx00".
  103.   In our case we change  it to 'CC' [-E 6556  FF.CC ]
  104.   and write it back out with a "W'.
  105.   Now if we rerun the chksum on the file it will have an 'XX00' checksum.
  106.  
  107.   AT roms are split evn/odd [low/high] because of the 16 bit address bus.
  108.   We need to split our file in this fashion to make it usable as a ROM
  109.   in an AT or AT clone. [Remember the checsum MUST end with 'xx00' for
  110.   the combined file not neccesarily for the split ones individualy.]
  111.   
  112.   When we run the SPLIT program on our new file ATROM, we get ATROM.EVN and
  113.   ATROM.ODD suitable as input files for eprom burners.
  114.   
  115.   I hope you'll find these ROMTOOLS useful...  Pete Korner
  116.  
  117.